<#assign menu="report">
<#assign submenu="report_add">
<#include "/system/head.ftl">

<body>
<section id="main-content">
    <section class="wrapper">
        <div class="tab-content">

            <div class="tab-pane active" id="tab_2">
                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption">
                            <i class="fa fa-gift"></i>添加举报原因
                        </div>
                    </div>
                    <div class="portlet-body form">
                        <!-- BEGIN FORM-->
                        <form id="addForm" method="post" action="${basePath}/admin/report/add.json" autocomplete="off"
                              class="form-horizontal">
                            <div class="form-body">
                                <div class="row">
                                    <div class="col-md-6" style="text-align:center">
                                        <div class="form-group">
                                            <label class="control-label col-md-3">原因
                                                <span class="required" aria-required="true">* </span>
                                            </label>

                                            <div class="col-md-9">
                                                <input name="name" type="text" class="form-control">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>

                            <div class="form-actions fluid">
                                <div class="col-md-offset-6 col-md-6">
                                    <button type="submit" class="btn blue">提交</button>
                                </div>
                            </div>

                        </form>


                    </div>
                </div>
            </div>
        </div>
    </section>
</section>
</body>


<#include "/system/foot.ftl">


<script>

    $('#addForm').validate({

        submitHandler: function (form) {

            $('#addForm').ajaxSubmit(function (data) {

                if (data.result) {

                    location.href = "/admin/report/list.htm";
                } else {
                    $('.alert-danger span', $('#addForm')).html(data.msg);
                    $('.alert-danger', $('#addForm')).show();
                }
            });
        }
    });

</script>

